﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class student_generateJudge : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string test_question_id = Request.QueryString["test_question_id"].ToString().Trim();
        string sql = "select top " + Session["judge_questions_sum"] + " judge_question_id ,judge_question_title,correct_answer,question_score from tb_judge_questions  where course_id in (select course_id from tb_test_info where test_question_id ='" + test_question_id + "') order by NEWID()";
        System.Data.DataTable dt = SqlServer.GetDataTable(sql);
        //转为文本串；
        Session["judge_answer"] = dt.DefaultView.ToTable(false, new string[] { "correct_answer", "question_score" });
        dt.Columns.RemoveAt(dt.Columns.Count - 1);
        dt.Columns.RemoveAt(dt.Columns.Count - 1);
        Response.Write(Json.ToJson(dt, 20));
        Response.End();
    }
}